package com.vhall.component.dao.interactive;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.vhall.component.entity.room.RoomDocumentsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * 文档关联mapper类
 *
 * @author CodeGenerator
 * @date 2021-04-14 15:50:28
 */
@Mapper
@Repository
public interface DocumentsRoomMapper extends BaseMapper<RoomDocumentsEntity> {

    /**
     * 查询文档数（admin）
     *
     * @param queryWrapper 查询条件
     * @return 房间数
     */
    @Select("select count(*) from room_documents left join account on room_documents.account_id = account.account_id ${ew.customSqlSegment}")
    Integer countDocumentForAdmin(@Param(Constants.WRAPPER) Wrapper<Object> queryWrapper);
}
